package ca.uwo.android.campusmap;

import java.util.ArrayList;
import java.util.List;

public class BuildingList {
	// Data
	static final String BUILDING_DATA = "building";

	List<BuildingData> buildings = new ArrayList<BuildingData>();
	
	// mutator
	public void addBuilding(BuildingData building) {
		buildings.add(building);
	}
	
	// accessor
	public int getSize() {
		return buildings.size();
	}
	
	public BuildingData getBuildingData(int i) {
		return buildings.get(i);
	}
	
	public String toXML() {
		StringBuffer sb = new StringBuffer();
		sb.append("<list>\n");
		for(int i = 0; i < buildings.size(); i++) {
			sb.append(buildings.get(i).toXML() + "\n");
		}
		sb.append("</list>\n");
		
		return sb.toString();
	}
}
